<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>


<div class="well well-statistc">
	<div class="span3">
		<table class="table table-bordered">
			<caption><i class="icon-tasks"></i> CONSULTAS </caption>
			<thead>
				<tr>
					<td>
						HOJE
						<div class="progress progress-success">
							<div class="bar" style="width: 100%">${qntConsultasHoje}</div>
						</div>
					</td>
				</tr>
				<tr>
					<td>
						ESSA SEMANA
						<div class="progress progress-success">
							<div class="bar" style="width: 100%">${qntConsultasSemana}</div>
						</div>
					</td>
				</tr>
				<tr>
					<td>
						ESSE MÊS
						<div class="progress progress-success">
							<div class="bar" style="width: 100%">${qntConsultasMes}</div>
						</div>
					</td>
				</tr>
			</thead>
		</table>
	</div>
	<div class="span3">
		<table class="table table-bordered">
			<caption><i class="icon-tasks"></i> % CONSULTAS PARTICULARES </caption>
			<thead>
				<tr>
					<td>
						HOJE
						<div class="progress progress-success">
							<div class="bar" style="width: ${pcntConsultasParticularHoje}%">
								${pcntConsultasParticularHoje}% <i class="icon-ok icon-white"></i>
							</div>
						</div>
					</td>
				</tr>
				<tr>
					<td>
						ESSA SEMANA
						<div class="progress progress-success">
							<div class="bar" style="width: ${pcntConsultasParticularSemana}%">
								${pcntConsultasParticularSemana}% <i class="icon-ok icon-white"></i>
							</div>
						</div>
					</td>
				</tr>
				<tr>
					<td>
						ESSE MÊS
						<div class="progress progress-success">
							<div class="bar" style="width: ${pcntConsultasParticularMes}%">
								${pcntConsultasParticularMes}% <i class="icon-ok icon-white"></i>
							</div>
						</div>
					</td>
				</tr>
			</thead>
		</table>
	</div>
	<div class="span3">
		<table class="table table-bordered">
			<caption><i class="icon-tasks"></i> % CONSULTAS CONVENIADAS</caption>
			<thead>
				<tr>
					<td>
						HOJE
						<div class="progress progress-success">
							<div class="bar" style="width: ${pcntConsultasConvenioHoje}%">
								${pcntConsultasConvenioHoje}% <i class="icon-ok icon-white"></i>
							</div>
						</div>
					</td>
				</tr>
				<tr>
					<td>
						ESSA SEMANA
						<div class="progress progress-success">
							<div class="bar" style="width: ${pcntConsultasConvenioSemana}%">
								${pcntConsultasConvenioSemana}% <i class="icon-ok icon-white"></i>
							</div>
						</div>
					</td>
				</tr>
				<tr>
					<td>
						ESSE MÊS
						<div class="progress progress-success">
							<div class="bar" style="width: ${pcntConsultasConvenioMes}%">
								${pcntConsultasConvenioMes}% <i class="icon-ok icon-white"></i>
							</div>
						</div>
					</td>
				</tr>
			</thead>
		</table>
	</div>
</div>

<div class="well well-large">
	<div class="span3">
		<table class="table table-bordered">
		   	<caption><i class="icon-th-list"></i> ÚLTIMAS CONSULTAS REALIZADAS </caption>
		   	<thead>
				<tr>
			    	<th>ESPECIALISTA</th>
			    	<th>DATA/HORA</th>
			    	<th>VALOR</th>
			    </tr>
			</thead>
			<tbody>
				<c:if test="${empty ultimasConsultas}">
					<tr>
						<td colspan="4">
							<div class="alert alert-block">
						    	<button name="skipAjax" type="button" class="close" data-dismiss="alert">&times;</button>
						    	Nenhuma consulta realizada
						    </div>
					    </td>
				    </tr>
				</c:if>
				<c:forEach items="${ultimasConsultas}" var="consulta">
					<tr>
						<td>${consulta.especialista.usuario.nome}</td>
						<td>${consulta.data} ${consulta.horaInicial}</td>
						<td>${consulta.valor}</td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
	</div>

	<div class="span3">
		<table class="table table-bordered">
		   	<caption><i class="icon-th-list"></i> PRÓXIMAS CONSULTAS </caption>
		   	<thead>
				<tr>
			    	<th>ESPECIALISTA</th>
			    	<th>TIPO</th>
			    	<th>DATA/HORA</th>
			    </tr>
			</thead>
			<tbody>
				<c:if test="${empty proximasConsultas}">
					<tr>
						<td colspan="4">
							<div class="alert alert-block">
						    	<button name="skipAjax" type="button" class="close" data-dismiss="alert">&times;</button>
						    	Nenhuma consulta próxima marcada
						    </div>
					    </td>
				    </tr>
				</c:if>
				<c:forEach items="${proximasConsultas}" var="consulta">
					<tr>
						<td>${consulta.especialista.usuario.nome}</td>
						<td>${consulta.tipo}</td>
						<td>${consulta.data} ${consulta.horaInicial}</td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
	</div>

	<div class="span3">
		<table class="table table-bordered">
		   	<caption><i class="icon-th-list"></i> ÚLTIMOS PACIENTES CADASTRADOS </caption>
		   	<thead>
				<tr>
			    	<th>NOME</th>
			    	<th>DATA</th>
			    	<th>HORA</th>
			    	<th>STATUS</th>
			    </tr>
			</thead>
			<tbody>
				<c:if test="${empty ultimosPacientes}">
					<tr>
						<td colspan="4">
							<div class="alert alert-block">
						    	<button name="skipAjax" type="button" class="close" data-dismiss="alert">&times;</button>
						    	Nenhum paciente cadastrado
						    </div>
					    </td>
				    </tr>
				</c:if>
				<c:forEach items="${ultimosPacientes}" var="paciente">
					<tr>
						<td>${paciente.usuario.nome}</td>
						<td>${paciente.usuario.data}</td>
						<td>${paciente.usuario.hora}</td>
						<td>
							<c:choose>
	    						<c:when test="${paciente.usuario.status eq 'INATIVO'}">
	    							<span class="label label-important"><i class="icon-remove icon-white"></i> INATIVO</span>
	    						</c:when>
	    						<c:otherwise>
	    							<span class="label label-success"><i class="icon-ok icon-white"></i> ATIVO</span>
	    						</c:otherwise>
	    					</c:choose>
						</td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
	</div>

	<!-- div class="span3">
		<table class="table table-bordered">
		   	<caption><i class="icon-th-list"></i> PRÓXIMOS ANIVERSÁRIOS </caption>
		   	<thead>
				<tr>
					<th>Nome</th>
			    	<th>Tipo</th>
			    	<th>Data</th>
			    </tr>
			</thead>
			<tbody>
				<c:if test="${empty aniversariantes}">
					<tr>
						<td colspan="4">
							<div class="alert alert-block">
						    	<button name="skipAjax" type="button" class="close" data-dismiss="alert">&times;</button>
						    	Não há aniversários próximos
						    </div>
					    </td>
				    </tr>
				</c:if>
				<c:forEach items="${aniversariantes}" var="aniversariante">
				</c:forEach>
			</tbody>
		</table>
	</div -->
	
</div>